package zjut.cocouml.figure;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.ToolbarLayout;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Rectangle;

public class BCanvasFigure extends Figure {
	private Label labelName = new Label();
	
	public void setLabelName(String name) {
		this.labelName.setText(name);
	}
	public String getLabelName() {
		return this.labelName.getText();
	}
	
	public void setLayout(Rectangle rect) {
		getParent().setConstraint(this, rect);
	}
	
	public BCanvasFigure() {
		XYLayout layout = new XYLayout();
		//ToolbarLayout layout = new ToolbarLayout();
		this.setLayoutManager(layout);
		this.setBackgroundColor(ColorConstants.white);
		this.setForegroundColor(ColorConstants.black);
		this.setBorder(new LineBorder(1)); 
		this.setOpaque(true);
	}
}
